<?php
$uren = array();

$fp = fopen("indicatie.txt",'r');

$total = 0;

echo "<pre>";

while(!feof($fp) ){
    $line = fgets($fp);
    
        
    
    if(preg_match("/\[\d+/", $line)){
//        echo htmlentities($line)."\n";
        
        if(preg_match_all("/\[(\d+)/is", $line, $matches, PREG_SET_ORDER)){
//            print_r($matches);
            if(isset($matches[0][1]))
            {
                $minHours = $matches[0][1];
                $minHours -= 0.5; //marge per onderdeel
                $uren[] = $minHours;
                $total += $minHours;
            }
        }
        
    }
//    $count++;
}



fclose($fp);

//$emailaddresses = array_unique($emailaddresses);
echo $total. "<br/>";
print_r($uren);

echo "done";

